/**
 * $version:  0.1 
 * $Date: 2011-01-21 
 *
 * Copyright (C) 2010-2012 Jawa Software. All rights reserved.
 *
 */
package org.jawa.core.util.support;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.jawa.core.database.DbConnectionManager;

/**
 * 使用可滚动的Statement来提高性能。
 * 
 * @author Y-N
 * 
 */
public class FastQueryRunner extends QueryRunner {

	public FastQueryRunner() {
		super();
	}

	/**
	 * 使用可滚动的Statement来提高查询时的分页性能。
	 * 
	 * @param con
	 *            数据库连接
	 * @param sql
	 *            数据库查询语句
	 * @return 一个可滚动的 PreparedStatement
	 */
	protected PreparedStatement prepareStatement(Connection con, String sql) throws SQLException {
		return DbConnectionManager.createScrollablePreparedStatement(con, sql);
	}
}
